package cj.web.sc.dao;
/*
 *  
 *  
*/
import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import net.paoding.rose.jade.annotation.SQLParam;
import cj.web.sc.domain.SCOrderItems;

/**
 * 
 * @author 
 *
 */
@DAO
public interface SCOrderItemsDAO{
    @SQL("select * from SCOrderItems where id=:1")
    SCOrderItems queryById(String id);
    
    @SQL("INSERT INTO SCOrderItems (orderId,goodsItemId,goodsItemName,goodsItemImage,goodsItemPrice,count,deleteFlag,createUser,createAt,updateUser,updateAt) VALUES (:t.orderId,:t.goodsItemId,:t.goodsItemName,:t.goodsItemImage,:t.goodsItemPrice,:t.count,:t.deleteFlag,:t.createUser,NOW(),:t.updateUser,NOW())")
    void create(@SQLParam("t") SCOrderItems sCOrderItems);
	
    @SQL("UPDATE SCOrderItems SET deleteFlag=0 WHERE id=:1")
    void deleteById(String id);

    @SQL("select * from SCOrderItems where deleteFlag=1 and orderId=:t.orderId limit :t.start,:t.length")
	List<SCOrderItems> queryByOrderId(@SQLParam("t")SCOrderItems orderItems);

    @SQL("select count(0) from SCOrderItems where deleteFlag=1 and orderId=:t.orderId")
	int sizeByOrderId(@SQLParam("t")SCOrderItems orderItems);
    
    
}